<style>
  label{ line-height: normal}
  .add-phone,.delete-phone{ width: 30px;height: 30px; text-align: center;line-height: 30px; border-radius: 50%; background: #5BC0DE;display: inline-block; font-size: 16px; color: #fff; cursor: pointer; margin-left: 10px}
  .delete-phone{   border:1px solid #E53573; color: #E53573; background: #fff; font-weight: bold; line-height: 26px }

  .roomsTab li{ display: inline-block; padding: 6px 12px; border: 1px solid #ccc; border-bottom: none; margin-right: -1px; cursor: pointer; margin-bottom: -1px}
  .roomsTab li.hover{ border-bottom: 1px solid #fff}
  .roomsTab { border-bottom: 1px solid #ccc; margin-bottom: 10px}
  .roomsContent{ display: none}
  #editor span{ min-width:0px}
  .add-phone,.delete-phone{ width: 30px;height: 30px; text-align: center;line-height: 30px; border-radius: 50%; background: #5BC0DE;display: inline-block; font-size: 16px; color: #fff; cursor: pointer; margin-left: 10px}
  .delete-phone{   border:1px solid #E53573; color: #E53573; background: #fff; font-weight: bold; line-height: 26px }

</style>


<script type="text/javascript" charset="utf-8" src="/static/libs/ue/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/static/libs/ue/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="/static/libs/ue/lang/zh-cn/zh-cn.js"></script>

<div class="crumbs" >
  <h3>拼团编辑</h3>
  <p><a ui-sref="main.groupbuy-list" >拼团管理</a> > <a ui-sref="main.groupbuy-list" >拼团列表</a> >拼团编辑</p>
</div>


<div class="content-box" >

  <div class="form-inline form-group">
    <table class="input-table-default">
      <tr>
        <td><span>主题名称：</span></td>
        <td>
          <input type="text" class="form-control required " size="50"  maxlength="30" placeholder="主题名2-30个字符,不能为纯数字"  ng-model="dataInfo.name" ng-required="true"   ng-maxlength="30" ng-minlength="2" ng-pattern="pubRegex.reNumber"  ng-blur="name = !dataInfo.name"  ng-class="{err:name }"  />
        </td>
      </tr>

      <tr>
        <td><span>简要描述：</span></td>
        <td>
          <input type="text" class="form-control required " size="80"  maxlength="30" placeholder="描述2-30个字符,不能为纯数字"  ng-model="dataInfo.shortDesc" ng-required="true"   ng-maxlength="30" ng-minlength="2" ng-pattern="pubRegex.reNumber"  ng-blur="shortDesc = !dataInfo.shortDesc"  ng-class="{err:shortDesc }"  />
        </td>
      </tr>
      <tr>
        <td class="v-top"><span>主题图片：</span></td>
        <td>
            <!---->
            <div class="upimg-inline-block ">
                  <dl>
                    <dd ><button type="button"  class="btn btn-info " id="picUrl">上传图片<i></i> </button><div class="img-show-box"></div><input type="hidden"  ng-model="brandInfo.picUrl" /></dd>
                    </dl>
            </div>
            <!---->
        </td>
      </tr>

      <tr>
        <td><span>达成人数：</span></td>
        <td>
          <input type="text" class="form-control " size="20" ng-minlength="0"  maxlength="6" placeholder="数字" ng-model="dataInfo.personCount  "  ng-blur="personCount= !dataInfo.personCount||dataInfo.personCount<2  " ng-pattern="pubRegex.short_number"  ng-class="{err:personCount }" />
        </td>
      </tr>

      <tr>
        <td><span>拼团时间：</span></td>
        <td>
          <div class="input-append date form_datetime_start inline-block" >
            <i class="add-on pa mt30" ><i class="icon-th"></i></i>
            <input class=" form-control " size="20" placeholder="起始时间" type="text"    onkeyup="this.value=''" id="beginTime" >
          </div> ----
          <div class="input-append date form_datetime_end inline-block" >
            <i class="add-on pa mt30" ><i class="icon-th"></i></i>
            <input class=" form-control " size="20" type="text"  placeholder="结束时间" onkeyup="this.value=''" id="endTime">
          </div>
          <input type="hidden" ng-class="{err:!dateThan==''}">
          <i class="f12 c-red" >{{dateThan}}</i>
        </td>
      </tr>
      <tr>
        <td><span>支付金额：</span></td>
        <td>
          <input type="text" class="form-control " size="20" ng-minlength="0"  maxlength="8" placeholder="0～10000,0元则免费" ng-model="dataInfo.payAmount "  ng-blur="payAmount   = dataInfo.payAmount!==0&&!dataInfo.payAmount  " ng-pattern="pubRegex.price"  ng-class="{err:payAmount ||(dataInfo.payAmount>10000)||(dataInfo.payAmount <0)}" />
        </td>
      </tr>


      <tr>
        <td><span>活动状态：</span></td>
        <td>
          <select class="form-control "  ng-init="states=[{id:1,name:'启动'},{id:2,name:'关闭'}]"  ng-options="v.id as v.name for v in states" ng-model="dataInfo.state"  ng-blur="state=!dataInfo.state "  ng-class="{err:state }"  >
            <option value="">--选择状态--</option>
          </select>
        </td>
      </tr>

      <tr>
        <td><span>关联拼团券：</span></td>
        <td>
          <select class="form-control "   ng-options="v.id as v.ticketName for v in ticketTypes" ng-model="dataInfo.ticketType"  ng-blur="ticketType=!dataInfo.ticketType"  ng-class="{err:ticketType}"  >
            <option value="">--选择--</option>
          </select>
        </td>
      </tr>


      <!--<tr>-->
        <!--<td><span>关联安慰奖：</span></td>-->
        <!--<td>-->
          <!--<select class="form-control "   ng-options="v.id as v.ticketName for v in comfortTicketTypes" ng-model="dataInfo.comfortTicketType"  >-->
            <!--<option value="">&#45;&#45;选择&#45;&#45;</option>-->
          <!--</select>-->
          <!--<i class="f12 c999">(选填)</i>-->
        <!--</td>-->
      <!--</tr>-->


      <tr>
        <td><span>推客设置：</span></td>
        <td>
          <label  ><input type="checkbox"  ng-checked="dataInfo.freeCreate===true"  ng-model="dataInfo.freeCreate"  >免费发起</label>
          <label class="ml50"  ><input type="checkbox" ng-value="true" ng-checked="dataInfo.freeJoin===true"  ng-model="dataInfo.freeJoin" >免费参加</label>
        </td>
      </tr>

      <tr >
        <td class="v-top"><span>短视频：</span></td>
        <td>
          <!---->
          <div>
            <ul>
              <li class="inline-block">
                <button type="button" class="btn btn-info " ng-init="initCreateV={maxLen:1,minLen:0}"   ng-click="createVideoDialog( {lastData:getVideos,addData:{},maxLen:initCreateV.maxLen})"  > 添加短视频</button>
                <i class="f12 c-999 ml10">(选填)</i></li>
              <input class="form-control creatVlen " type="hidden" ng-blur="creatVlen=getVideos.length<initCreateV.minLen"  ng-class="{err:creatVlen }"/>
              <i class="f12 c-red  block"  ng-if="creatVlen">请上传一个视频！</i>
            </ul>
            <ul class="create-dialog-list inline-block mt10 " style="width: 60%" ng-if="getVideos.length">
              <li  ng-model="getVideos" ng-repeat="g in getVideos track by $index" class="f12 lh260" >
                <i class="iconfont"></i>
                <a class="cursor"   data-target='.myModalVideo' ng-click="createVideoShow(g.url)"  data-toggle='modal' title="{{g.name}}">
                  <img ng-src="{{g.url}}?vframe/jpg/offset/{{g.second}}/w/50/h/30" alt="缩略图"><em class="ml10">{{g.name}}</em> <i class="c-999"> 时长:{{g.duration | number:2}}</i>
                </a>
                            <span class="float-right c-999">
                            <i class="iconfont f12"></i>
                            <a href="javascript:void(0)"  data-target='.upVideoDialog'   data-toggle='modal' ng-click="createVideoDialog( {lastData:getVideos,addData:g,index:$index})" >编辑</a>
                            <i class="iconfont f12"></i>
                            <a  href="javascript:void(0)" ng-click="createVideoDel([getVideos,g])">移除</a>
                            </span>
              </li>
            </ul>

          </div>
          <!---->
        </td>
      </tr>






      <tr>
        <td class="v-top"><span>主题描述：</span></td>
        <td >
          <!--style给定宽度可以影响编辑器的最终宽度-->
          <script id="editor" type="text/plain" style="width:940px;height:400px; overflow-x:hidden "></script>
          <!--style给定宽度可以影响编辑器的最终宽度结束-->
        </td>
      </tr>









      <tr>
        <td></td>
        <td>
          <button ng-click="submit([dataInfo,true])"  type="button" class="btn btn-primary w110">提交</button>
        </td>
      </tr>


    </table>
  </div>

</div>

<!--dialog上传视频模块-->
<div class="modal fade upVideoDialog create-dialog-box" >
  <div class="modal-dialog " style="width: 800px">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" ng-if="createVideoTitleAdd">添加视频</h4>
        <h4 class="modal-title" ng-if="!createVideoTitleAdd">编辑视频</h4>
      </div>
      <div class="modal-body" ng-show="maxlengtherr">
        <p class="text-center lh320 c-red f14 ">不能添加，最大上传数量为{{maxlength}}</p>
      </div>

      <div class="modal-body" ng-show="!maxlengtherr" >
        <div class="dialog-content ml20 ">
          <dl class="  form-inline form-group" >
            <dd><span>视频名称：</span><input  class="form-control "     type="text"  ng-model="createVideoInfo.name" maxlength="30"  placeholder="名称30字符内，不能为纯数字" ng-pattern="pubRegex.reNumber"  autocomplete="off"></dd>
            <dd><span>上传视频：</span>
              <div class="inline-block">
                <button type="button"  class="btn btn-info " id="upVideoBtn"> 选择视频 <i></i></button>
                <em class="f12 c-999 ml10">（上传视频格式为mp4；单个视频不超过200M。）</em>
                <div class="mt10 video-list-content"></div><input type="hidden"  ng-model="createVideoInfo.url"  />
              </div>
            </dd>
            <dd>
              <span style="vertical-align: top">视频缩略图：</span>
              <div class="inline-block">
                <input type="hidden" ng-model="createVideoInfo.duration"/>
                <input type="text" class="form-control " ng-model="createVideoInfo.second" ng-maxlength="5" ng-minlength="1"  ng-pattern="pubRegex.short_number" maxlength="5" style="width: 100px" >
                <button type="button"  class="btn btn-info " id="getVideoPic" style='min-width: 136px' ng-disabled="!createVideoInfo.url" ng-click="createVideoShowVideoPics(createVideoInfo)">查看缩略图<i></i></button>
                <em class="f12 c-999">（默认获取视频第<i class="defSec"></i>秒图片，可手动设置秒数。）</em>
                <p class='mt10' ng-show="createVideoShowPics" ><img ng-src="{{createVideoShowPics}}"/><p>
              </div>
            </dd>
            <p class="text-center c-red f12 "><em ng-bind="createVideoInfo.errorMsg"></em></p>
          </dl>
        </div>
      </div>
      <div class="modal-footer" ng-show="!maxlengtherr">
        <button type="button" class="btn btn-primary "  ng-click="createVideoSumbit(createVideoInfo)" >确定</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<div ng-include="'/templates/partial/show-img.html'"></div>
<div ng-include="'/templates/partial/show-video.html'"></div>


